<template>
    <div class="bot_nav_box">
        <router-link to="/home" class="item_box" tag="div">
            <div class="icon iconfont icon-shouye"></div>
            <div class="text">首页</div>
        </router-link>
        <router-link to="/categary" class="item_box" tag="div">
            <div class="icon iconfont icon-grouping"></div>
            <div class="text">分类</div>
        </router-link>
        <router-link to="/cart" class="item_box" tag="div">
            <div class="icon iconfont icon-gouwuche">
                <div v-if="$store.getters.cartNum" class="num">{{ $store.getters.cartNum }}</div>
            </div>
            <div class="text">购物车</div>
        </router-link>
        <router-link to="/user" class="item_box" tag="div">
            <div class="icon iconfont icon-31wode"></div>
            <div class="text">我的</div>
        </router-link>
    </div>
</template>

<style lang='less' scoped>
.bot_nav_box {
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 50px;
    box-shadow: 0 0px 8px 7px #ccc;
    background: #fff;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    text-align: center;

    .item_box {
        flex: 1;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;

        &.router-link-exact-active {
            color: #1baeae;
        }

        .icon {
            .van-icon {
                font-size: 30px;
            }
        }

        .iconfont {
            font-size: 0.55rem;
        }

        .icon-gouwuche {
            position: relative;
        }

        .num {
            width: 15px;
            height: 15px;
font-size: 15px;
line-height: 15px;
            position: absolute;
            top: -4px;
            right: -8px;
            background:rgb(247, 43, 43) ;
            border-radius: 50%;
            color: #fff;
            border: 1px solid #fff;
        }

        .text {
            font-size: .24rem
        }
    }
}
</style>

